# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: André Klitzing <aklitzing () gmail () com>

pkgname=clazy
pkgver=1.4
pkgrel=3
pkgdesc="Qt oriented code checker based on clang framework"
url="https://www.kdab.com/"
license=(GPL2)
depends=(clang)
makedepends=(cmake llvm)
arch=(x86_64)
source=(https://download.kde.org/stable/$pkgname/$pkgver/src/$pkgname-$pkgver.tar.xz{,.sig}
        clazy-docdir.patch::"https://cgit.kde.org/clazy.git/patch/?id=3a731ebf")
sha256sums=('3f5d5e148c9e9c4e43f095796261794da5385578d2375b12c9179d340d6d5a8a'
            'SKIP'
            '3a7cb81a9de25291903f722d3bbfd7ba02df0620f90e972c086d8ac999aaa2bd')
validpgpkeys=(949014B23D24354DFD548E5457416A0ADCEF0EFE) # Sergio Martins <sergio.martins@kdab.com>

prepare() {
  mkdir -p build

  cd $pkgname-$pkgver
  patch -p1 -i ../clazy-docdir.patch # Fix doc dir in launcher script
}

build() {
  cd build
  cmake ../$pkgname-$pkgver \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib
  make
}

package() {
  cd build
  make DESTDIR="$pkgdir" install
}
